package model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import metier.GameState;
import metier.Objet;
import model.actions.Action;
import model.conditions.Condition;

public class Behaviour implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = -3938073463049019314L;
	protected Set<Condition> conditions = new HashSet<Condition>();
	protected List<Action> actions = new ArrayList<Action>();
	
	public Set<Condition> getConditions() {
		return conditions;
	}
	public void setConditions(Set<Condition> conditions) {
		this.conditions = conditions;
	}
	public List<Action> getActions() {
		return actions;
	}
	public void setActions(List<Action> actions) {
		this.actions = actions;
	}
	
	public Boolean verifyConditions(GameState state, Objet sender) {
		Boolean res = true;
		for(Condition cond : conditions) {
			res = res && cond.verify(state, sender);
		}
		return res;
	}
}
